from fb.open_graph.models import OpenGraphObject


class Article(OpenGraphObject):
  
  def get_open_graph_type(self):
    return 'article'
  
  def get_article_published_time(self):
    return ''
  
  def get_article_modified_time(self):
    return ''
  
  def get_article_expiration_time(self):
    return ''
  
  def get_article_authors(self):
    return ()
  
  def get_article_section(self):
    return ''
  
  def get_article_tags(self):
    return ()
  
  def get_open_graph_attributes(self):
    attrs = super(Article, self).get_open_graph_attributes()
    attrs.append(('article:published_time', self.get_article_published_time()))
    attrs.append(('article:modified_time', self.get_article_modified_time()))
    attrs.append(('article:expiration_time', self.get_article_expiration_time()))
    attrs.append(('article:section', self.get_article_section()))
    
    for author in self.get_article_authors():
      attrs.append(('article:author', author))
      
    for tag in self.get_article_tags():
      attrs.append(('article:tag', tag))
      
    return attrs
  
  
class Book(OpenGraphObject):
  def get_open_graph_type(self):
    return 'book'
  
  def get_book_authors(self):
    return ()
  
  def get_book_isbn(self):
    return ''
  
  def get_book_release_date(self):
    return ''
  
  def get_book_tags(self):
    return ()
  
  def get_open_graph_attributes(self):
    attrs = super(Book, self).get_open_graph_attributes()
    attrs.append(('book:isbn', self.get_book_isbn()))
    attrs.append(('book:release_date', self.get_book_release_date()))
    
    for author in self.get_book_authors():
      attrs.append(('book:author', author))
      
    for tag in self.get_book_tags():
      attrs.append(('book:tag', tag))
    
    return attrs
  
  
class Profile(OpenGraphObject):
  def get_open_graph_type(self):
    return 'profile'
  
  def get_profile_first_name(self):
    return ''
  
  def get_profile_last_name(self):
    return ''
  
  def get_profile_username(self):
    return ''
  
  def get_profile_gender(self):
    return ''
  
  def get_open_graph_attributes(self):
    attrs = super(Profile, self).get_open_graph_attributes()
    attrs.append(('profile:first_name', self.get_profile_first_name()))
    attrs.append(('profile:last_name', self.get_profile_last_name()))
    attrs.append(('profile:username', self.get_profile_username()))
    attrs.append(('profile:gender', self.get_profile_gender()))
    return attrs
  